package com.shenrongrong.common;

public class Result {
    private String status;
    private String msg;
    private Object data;

    public static Result success(){
        Result result = new Result();
        result.setStatus("200");
        result.setMsg("请求成功");
        return result;
    }

    public static Result success(Object data){
        Result result = success();
        result.setData(data);
        return result;
    }

    public static Result error(String msg){
        Result result = new Result();
        result.setStatus("500");
        result.setMsg(msg);
        return result;
    }

    public static Result error(String status,String msg){
        Result result = new Result();
        result.setStatus(status);
        result.setMsg(msg);
        return result;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
